package com.heima.admin.controller.v1;

import com.heima.admin.service.AdChannelService;
import com.heima.apis.wemedia.IWeMediaClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.dtos.WmChannelDto;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.UnitsMultiple;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController {

    @Autowired
    private IWeMediaClient iWeMediaClient;

    @PostMapping("/list")
    public ResponseResult findSensitive(@RequestBody SensitiveDto dto){
        return iWeMediaClient.findSensitive(dto);
    }

    @PostMapping("/save")
    public ResponseResult saveSensitive(@RequestBody WmSensitive wmSensitive){
        return iWeMediaClient.saveSensitive(wmSensitive);
    }

    @DeleteMapping("/del/{id}")
    public ResponseResult deleteSensitive(@PathVariable Integer id){
        return iWeMediaClient.deleteSensitive(id);
    }

    @PostMapping("/update")
    public ResponseResult upfateSensitive(@RequestBody WmSensitive wmSensitive){
        return iWeMediaClient.updateSensitive(wmSensitive);
    }
}